package com.test.nnooolwdeaer.bean_wooden.user_info_wooden;

import com.test.nnooolwdeaer.util_wooden.StringUtil_wooden;
import com.google.gson.Gson;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.LinkedHashMap;

public class LoanLimitInfo_wooden {

    private static class Inner_wooden {
        private static LoanLimitInfo_wooden instance = new LoanLimitInfo_wooden();
    }

    private LoanLimitInfo_wooden(){}

    public static LoanLimitInfo_wooden getInstance_wooden(){
        return Inner_wooden.instance;
    }

    private String newUserFlag;
    private ArrayList<LinkedHashMap<String,String>> limit;

    public static void parse_wooden(JSONObject objJson){
        Inner_wooden.instance = new Gson().fromJson(objJson.toString(), LoanLimitInfo_wooden.class);
    }

    public boolean isNewUSer_wooden() {
        return StringUtil_wooden.getSafeString_wooden(newUserFlag).equalsIgnoreCase("YES");
    }

    public String getLimitAmount_wooden(){
        if (limit == null||limit.size()==0) return "";
        return limit.get(0).get("amount");
    }

    public String getLimitIncreasedAmount1_wooden(){
        if (limit == null||limit.size()==0) return "";
        return limit.get(0).get("increasedAmount1");
    }

    public String getLimitIncreasedAmount2_wooden(){
        if (limit == null||limit.size()==0) return "";
        return limit.get(0).get("increasedAmount2");
    }

}
